from soaplib.serializers.primitive import Array, Boolean, Integer, Float, String, DateTime
from soaplib.serializers.clazz import ClassSerializer

class Link(ClassSerializer):
  class types:
    source = String
    linktype = String
    target = String
    subscribe = Array(String)

class ResourceChange(ClassSerializer):
  class types:
    seqnum = Integer
    resource = String
    timestamp = DateTime
    changetype = Integer # 1: add, 2: change, 3: delete

class ChangeNotification(ClassSerializer):
  class types:
    seqnum = Integer
    changes = Array(ResourceChange)
